package com.jm.web.builder.table;

import java.io.IOException;

import com.jm.utils.StringBuilderEx;
import com.jm.utils.StringHelper;
import com.jm.web.builder.BaseBuilder;
import com.jm.web.data.ReturnData;
import com.jm.web.form.Button;
import com.jm.web.form.Paging;
import com.jm.web.form.Separate;
import com.jm.web.form.Toolbar;

public class PagingBuilder extends BaseBuilder{
	@Override
	public void RenderEnd() {
		if(!this.getBaseTag().getPage().isExport())
			try {
				ReturnData ret = this.getBaseTag().getPage().getReturnData();
				Paging paging = (Paging)ret.GetParamValue(StringHelper.Format("paging_%1$s",this.getBaseTag().getId()));
				StringBuilderEx sb = new StringBuilderEx();
				if(paging != null){
					paging.init(this.getBaseTag());
					sb.Append(paging.OutputHtmlCode());
					this.getOut().write(sb.toString());
				}
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
	}
}
